import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
import type {App} from 'vue'
import useLoginStore from './modules/login'

const pinia = createPinia()
pinia.use(piniaPluginPersist)

function registerStore(app:App<Element>) {
  app.use(pinia)
  const loginStore = useLoginStore()
  loginStore.loadLocalCacheAction()
}

export default registerStore
